package com.action.sboard;
import java.util.*;
import com.db.sboard.*;

public class ListAction {
	private int type;
	private String title;
	private List<BoardVO> list=new ArrayList<BoardVO>();
    private boardDAO sbDAO;    
    
	public String getTitle() {
		return title;
	}
	public int getType() {
		return type;
	}
	public void setType(int type) {
		this.type = type;
	}
	public void setSbDAO(boardDAO sbDAO) {
		this.sbDAO = sbDAO;
	}	
	public List<BoardVO> getList() {
		return list;
	}

	public String execute()throws Exception
	{		
		// 해당 타입의 게시물 목록만 얻어온다
		list = sbDAO.getBoardListByType(type);
		// 해당 타입의 분류명을 얻어온다 (게시판 제목 출력용)
		BoardTypeVO btvo = sbDAO.getBoardTypeContent(type);
		title = btvo.getBname();
		//System.out.println(list);
		return "success";
	}
	
}
